/*
ID: lanxiaz1
LANG: JAVA
TASK: snotes
*/
import java.io.*;
import java.util.Scanner;
import java.util.Arrays;
public class snotes
{
	public static void main(String[] args)throws Exception
	{
		BufferedReader f = new BufferedReader(new FileReader("snotes.in"));
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("snotes.out")));
		Scanner scan=new Scanner(f);
		int n=scan.nextInt();
		int q=scan.nextInt();
		int[] B=new int[n+1];
		B[0]=0;
		for(int i=1;i<=n;i++)
		{
			B[i]=B[i-1]+scan.nextInt();
		}
		for(int i=0;i<q;i++)
		{
			int t=scan.nextInt();
			int index=Arrays.binarySearch(B,t);
			int result=-1;
			if(index>=0)
			{
				result=index+1;
			}
			else
			{
				result=-index-1;
			}
			out.println(result);
		}
		out.flush();
		out.close();
	}
}
